Repository navigation
fix: batch parent-folder queries during recursive listings - #394
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the parent-folder query batching change.
No open issues 🎉
What changed in this PR
This PR addresses #393 by batching parent-folder queries in recursive Google Drive listings, preventing oversized queries that caused HTTP 400 errors during DVC cache traversal.
Changes:
- Limits queries to 50 parents and lazily yields each batch’s results while preserving existing pagination.
- Avoids requests for empty inputs.
- Adds offline regression tests for batch boundaries, iterable inputs, laziness, and 251-folder traversal with and without details.
| File | Description |
|---|---|
pydrive2/test/test_fs_listing.py |
Adds regression coverage for batching and wide recursive listings. |
pydrive2/fs/spec.py |
Implements lazy parent-query batching with an empty-input guard. |
Review effort: Balanced
Member
|
/test-drive |
Member
|
/test-drive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #393.
Recursive listings currently combine every parent folder into one unbounded query. A real DVC data-cache listing with 251 subfolders fails with HTTP 400; querying the same parents in batches succeeds.
Limit each query to 50 parents and lazily yield all results before requesting the next batch. Empty inputs issue no requests. This preserves the existing pagination performed by
_gdrive_list().Validation:
Related: #353, which was closed as a duplicate of a DVC run-cache issue. This reproduction affects regular data-cache traversal.